<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">
<jsp:include page="../../WEB-INF/incl/htmlHeader.jsp" />
<title>Schedule Maintenance | Cult Cinema Inc</title>
</head>
<body class="admin">
<script type="text/javascript">
	$(document).ready(function() {
		$('#scheduleStartDate').calendricalDate();
		$('#scheduleStartTime').calendricalTime();
	});
</script>
<jsp:include page="../../WEB-INF/incl/adminHeader.jsp" />
<div id="pageheader">
	<div class="container">
		<h1>Administration &gt; Schedule Maintenance</h1>
	</div>
</div>
<div id="main" class="container">
	<jsp:include page="../../WEB-INF/incl/messages.jsp" />
	
	<div class="entry">
		<a href="" class="UIImageBlock_Image"><img src="${requestScope.movie.imageUrl}" width="86" height="124"/></a>
		<div class="UIImageBlock_Content">
			<h1>${requestScope.movie.name}</h1>
			<p><fmt:formatDate value="${requestScope.movie.startDate}" pattern="dd/MM/yyyy" /> <fmt:message key="movie.startDate" bundle="${uitext}" /></p>
			<p><strong><fmt:message key="movie.description" bundle="${uitext}" />:</strong></p>
			<p>${requestScope.movie.description}</p>
			<p><strong><fmt:message key="movie.director" bundle="${uitext}" />:</strong> ${requestScope.movie.director}</p>
			<p><strong><fmt:message key="movie.cast" bundle="${uitext}" />:</strong> ${requestScope.movie.cast}</p>
			<p><strong><fmt:message key="movie.duration" bundle="${uitext}" />:</strong> ${requestScope.movie.duration}</p>
			<p><strong><fmt:message key="movie.category" bundle="${uitext}" />:</strong> ${requestScope.movie.category}</p>
			<p><strong><fmt:message key="movie.language" bundle="${uitext}" />:</strong> ${requestScope.movie.language}</p>
			<table class="data-table" cellspacing="0" cellpadding="0" width="100%">
				<thead>
					<tr>
						<th scope="col"><fmt:message key="common.id" bundle="${uitext}"/></th>
						<th scope="col"><fmt:message key="house.name" bundle="${uitext}"/></th>
						<th scope="col"><fmt:message key="schedule.scheduleStart" bundle="${uitext}"/></th>
						<th scope="col"><fmt:message key="schedule.price" bundle="${uitext}"/></th>
						<th scope="col"></th>
					</tr>
				</thead>
				<tbody>
					<c:forEach var="d" items="${requestScope.scheduleList}">
						<tr>
							<td>${d.id}</td>
							<td><p>${d.houseId}</p></td>
							<td><fmt:formatDate value="${d.scheduleStart}" pattern="dd/MM/yyyy hh:mmaaa" /></td>
							<td>${d.price}</td>
							<td>
								<a href="schedule.do?type=delete&amp;sid=${d.id}" onclick="return confirm('<fmt:message key="message.info.common.confirm.delete" bundle="${uitext}"/>')"><fmt:message key="table.action.delete" bundle="${uitext}"/></a>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<hr />
			<form method="post" action="schedule.do" class="cssform">
				<input type="hidden" name="movieId" value="${requestScope.movie.id}"/>
				<input type="hidden" name="movieDuration" value="${requestScope.movie.duration}"/>
				<p>
					<label class="f_label" for="house"><fmt:message key="house.name" bundle="${uitext}" /></label>
					<select name="houseId">
					<c:forEach var="h" items="${requestScope.houseList}">
						<option value="${h.id}">${h.name}</option>
					</c:forEach>
					</select>
				</p>
				<p>
					<label class="f_label" for="scheduleStartDate"><fmt:message key="form.label.scheduleStartDate" bundle="${uitext}" /></label>
					<input type="text" id="scheduleStartDate" name="scheduleStartDate" value="${param['scheduleStartDate']}"/>
				</p>
				<p>
					<label class="f_label" for="scheduleStartTime"><fmt:message key="form.label.scheduleStartTime" bundle="${uitext}" /></label>
					<input type="text" id="scheduleStartTime" name="scheduleStartTime" value="${param['scheduleStartTime']}"/>
				</p>
				<p>
					<label class="f_label" for="price"><fmt:message key="schedule.price" bundle="${uitext}" /></label>
					<input type="text" name="price" value="${param['price']}"/>
				</p>
				<p class="acts"><input type="submit" name="submit" id="submit" value="<fmt:message key="form.btn.add.schedule" bundle="${uitext}" />" class="text blue_btn"></p>
			</form>
		</div>
	</div>
</div>
<jsp:include page="../../WEB-INF/incl/footer.jsp" />
</body>
</html>
